/*
 *  ConcreteNoteGenerator.h
 *  SoundController0002
 *
 *  Created by jiro on 11/10/10.
 *  Copyright 2011 jiro music. All rights reserved.
 *
 */

#pragma once

#include "../HarmonicSystem/HarmonicSystem.h"
#include "ConcreteNote.h"

namespace sc
{
namespace system0039
{

	class ConcreteNote;

	class ConcreteNoteGenerator
	{
	private:
	
		double density;
		
		double duration;
		
		std::vector< ConcreteNote > muteNotes;
		
		std::vector< ConcreteNote > notes;		//	each note has the same probablity

	public:

		ConcreteNoteGenerator( double density, double duration );

		void AddNote( const ConcreteNote& note );

		void AddNotes( const std::vector< ConcreteNote >& notes ); 

		virtual int GetNoteCount() const;

		virtual ConcreteNote GetConcreteNote() const;

		bool operator == ( const ConcreteNoteGenerator& rhs ) const;

	protected:

		ConcreteNote GetMuteConcreteNote() const;

		double GetDensity() const;

	private:

		void ReCalcMuteNotes();
		
		double GetDurationAverage() const;

	};

}
}
